<?php

class Core_Model_Website_Collection_Sef extends Dcmp_Model_Collection_Strong {

    public function __construct() {
        parent::__construct();
        $this->setItemClass('website/sef');
        $this->from('{t}website_sef', 'a');
    }
    
    public function filterBy($name, $arg){
    	switch($name){
    		case 'sourceid':
    			return $this->eq('a.source_id', ':sourceId:s')->addParameter('sourceId', $arg);
    		case 'sourcetype':
    			return $this->eq('a.source_type', ':sourceType:s')->addParameter('sourceType', $arg);
    		case 'sourceids':
    			return $this->contain('a.source_id', ':sourceIds:s')->addParameter('sourceIds', $arg);
    		case 'rewriteurl':
    			return $this->contain('a.rewrite_url', ':rewriteUrl:s')->addParameter('rewriteUrl', $arg);
    	}
    	return parent::filterBy($name, $arg);
    }
}

